[LegacyColorValue = true]; 

{ TSM Key Reversal : Key reversal days
  Copyright 1999, P.J.Kaufman. All rights reserved.

  Function returns a 1 if a key reversal to the upside, and
	a -1 if a key reversal to the downside.

  Set the "style" for both key reversal indicators to "point" with
	weight 3 and scale to price.
}
	inputs: length(20);
	vars:	kr(0), pt(0);

	kr = TSMKeyReversal(high,low,close,length);

	if kr > 0 then begin
		pt = low - low/100;
		plot1(pt,"KRup");
		end;
	if kr < 0 then begin
		pt = high + high/100;
		plot2(pt,"KRdown");
		end;